"""
@Filename       : twitter_preprocess.py
@Create Time    : 2021/9/23 9:40
@Author         : Rylynn
@Description    : 

"""

for line in open('../../../data/twitter/cascade.txt'):
    if len(line.strip()) == 0:
        continue
    userlist = []
    time_list = []
    chunks = line.strip().split()[1:]
    for chunk in chunks:
        user, timestamp = chunk.split(',')
        user, timestamp = eval(user), eval(timestamp)
        time_list.append(timestamp)

    print(sorted(time_list) == time_list or sorted(time_list, reverse=True) == time_list)